<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>首页</title>
    <link rel="stylesheet" href="/plugins/bootstrap/css/bootstrap.css">
    <link rel="stylesheet" href="/plugins/swiper/css/swiper.css">
    <link rel="stylesheet" href="/css/github-markdown.css">
    <link rel="stylesheet" href="/css/index.css">
    <script src="/plugins/jquery/jquery-3.4.0.min.js"></script>
    <script src="/plugins/swiper/js/swiper.min.js"></script>
    <script src="/plugins/bootstrap/js/bootstrap.js"></script>
    <script src="/plugins/bootstrapPager.js"></script>


</head>

<body>
    <!-- 导航栏 -->
    <div class="container-fluid header">
        <div class="container-w">
            <div class="logo">
                    <a href="index.html">
                        <img src="/images/logo.png" alt="">
                    </a>
            </div>
            <div class="nav">
                <ul>
                    <li><a href="#">首页</a></li>
                    <li><a href="#">沸点</a></li>
                    <li><a href="#">话题</a></li>
                    <li><a href="#">活动</a></li>
                    <li><a href="#">关于我们</a></li>
                </ul>
            </div>
            <div class="loginbox">
                <a href="login.html">登录</a>
                <a href="register.html">注册</a>
            </div>
            <div class="search">
                <input type="text" placeholder="搜索文章">
            </div>
        </div>
    </div>

    <!-- 网站内容模块 -->
    <div class="container-w main">
        <div class="left">
            <div class="detail">
                <div class="markdown-body">
                    <p>以下 api 路径均以 <strong><a href="https://chuxin/api/v1" target="_blank">https://chuxin/api/v1</a></strong> 为前缀</p>
                    <p>update:接口统一需要token,后台可直接获取</p>
                    <h3>主题</h3>
                    <h4>get /list 主题首页</h4>
                    <p>接收 get 参数</p>
                    <ul>
                        <li>page <code>Number</code> 页数</li>
                        <li>tab <code>String</code> 主题分类。目前有 <code>ask</code> <code>share</code> <code>job</code> <code>good</code></li>
                        <li>limit <code>Number</code> 每一页的主题数量</li>
                        <li>mdrender <code>String</code> 当为 <code>false</code> 时，不渲染。默认为 <code>true</code>，渲染出现的所有 markdown 格式文本。</li>
                    </ul>
                    <p>示例：<a href="/api/v1/topics" target="_blank">/api/v1/topics</a></p>
                    <h4>get /topic/:id 主题详情</h4>
                    <p>接收 get 参数</p>
                    <ul>
                        <li>mdrender <code>String</code> 当为 <code>false</code> 时，不渲染。默认为 <code>true</code>，渲染出现的所有 markdown 格式文本。</li>
                        <li>accesstoken <code>String</code> 当需要知道一个主题是否被特定用户收藏以及对应评论是否被特定用户点赞时，才需要带此参数。会影响返回值中的 <code>is_collect</code> 以及 <code>replies</code> 列表中的 <code>is_uped</code> 值。</li>
                    </ul>
                    <p>示例：<a href="/api/v1/topic/5433d5e4e737cbe96dcef312" target="_blank">/api/v1/topic/5433d5e4e737cbe96dcef312</a></p>
                    <h3>主题收藏</h3>
                    <h4>post /topic_collect/collect 收藏主题</h4>
                    <p>接收 post 参数</p>
                    <ul>
                        <li>accesstoken <code>String</code> 用户的 accessToken</li>
                        <li>topic_id <code>String</code> 主题的id</li>
                    </ul>
                    <p>返回值示例</p>
                    <pre class="prettyprint language-js"><code><span class="pun">{</span><span class="str">"success"</span><span class="pun">:</span><span class="pln"> </span><span class="kwd">true</span><span class="pun">}</span></code></pre>
                    <h4>post /topic_collect/de_collect 取消主题</h4>
                    <p>接收 post 参数</p>
                    <ul>
                        <li>accesstoken <code>String</code> 用户的 accessToken</li>
                        <li>topic_id <code>String</code> 主题的id</li>
                    </ul>
                    <p>返回值示例</p>
                    <pre class="prettyprint language-js"><code><span class="pun">{</span><span class="pln">success</span><span class="pun">:</span><span class="pln"> </span><span class="kwd">true</span><span class="pun">}</span></code></pre>
                    <h4>get /topic_collect/:loginname 用户所收藏的主题</h4>
                    <p>示例：<a href="/api/v1/topic_collect/alsotang" target="_blank">/api/v1/topic_collect/alsotang</a></p>
                    <h3>用户</h3>
                    <h4>get /user/:loginname 用户详情</h4>
                    <p>示例：<a href="/api/v1/user/alsotang" target="_blank">/api/v1/user/alsotang</a></p>
                    <h4>post /accesstoken 验证 accessToken 的正确性</h4>
                    <p>接收 post 参数</p>
                    <ul>
                        <li>accesstoken <code>String</code> 用户的 accessToken</li>
                    </ul>
                    <p>如果成功匹配上用户，返回成功信息。否则 403。</p>
                    <p>返回值示例</p>
                    <pre class="prettyprint language-js"><code><span class="pun">{</span><span class="pln">success</span><span class="pun">:</span><span class="pln"> </span><span class="kwd">true</span><span class="pun">,</span><span class="pln"> loginname</span><span class="pun">:</span><span class="pln"> req</span><span class="pun">.</span><span class="pln">user</span><span class="pun">.</span><span class="pln">loginname</span><span class="pun">,</span><span class="pln"> id</span><span class="pun">:</span><span class="pln"> req</span><span class="pun">.</span><span class="pln">user</span><span class="pun">.</span><span class="pln">id</span><span class="pun">,</span><span class="pln"> avatar_url</span><span class="pun">:</span><span class="pln"> req</span><span class="pun">.</span><span class="pln">user</span><span class="pun">.</span><span class="pln">avatar_url</span><span class="pun">}</span></code></pre>
                    <h3>消息通知</h3>
                    <h4>get /message/count 获取未读消息数</h4>
                    <p>接收 get 参数</p>
                    <ul>
                        <li>accesstoken <code>String</code></li>
                    </ul>
                    <p>返回值示例</p>
                    <pre class="prettyprint language-js"><code><span class="pun">{</span><span class="pln"> data</span><span class="pun">:</span><span class="pln"> </span><span class="lit">3</span><span class="pln"> </span><span class="pun">}</span></code></pre>
                    <h4>get /messages 获取已读和未读消息</h4>
                    <p>接收 get 参数</p>
                    <ul>
                        <li>accesstoken <code>String</code></li>
                        <li>mdrender <code>String</code> 当为 <code>false</code> 时，不渲染。默认为 <code>true</code>，渲染出现的所有 markdown 格式文本。</li>
                    </ul>
                    <p>返回值示例</p>
                    <pre class="prettyprint language-js"><code><span class="pun">{</span><span class="pln">
                          data</span><span class="pun">:</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
                            has_read_messages</span><span class="pun">:</span><span class="pln"> </span><span class="pun">[],</span><span class="pln">
                            hasnot_read_messages</span><span class="pun">:</span><span class="pln"> </span><span class="pun">[</span><span class="pln">
                              </span><span class="pun">{</span><span class="pln">
                                id</span><span class="pun">:</span><span class="pln"> </span><span class="str">"543fb7abae523bbc80412b26"</span><span class="pun">,</span><span class="pln">
                                type</span><span class="pun">:</span><span class="pln"> </span><span class="str">"at"</span><span class="pun">,</span><span class="pln">
                                has_read</span><span class="pun">:</span><span class="pln"> </span><span class="kwd">false</span><span class="pun">,</span><span class="pln">
                                author</span><span class="pun">:</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
                                  loginname</span><span class="pun">:</span><span class="pln"> </span><span class="str">"alsotang"</span><span class="pun">,</span><span class="pln">
                                  avatar_url</span><span class="pun">:</span><span class="pln"> </span><span class="str">"https://avatars.githubusercontent.com/u/1147375?v=2"</span><span class="pln">
                                </span><span class="pun">},</span><span class="pln">
                                topic</span><span class="pun">:</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
                                  id</span><span class="pun">:</span><span class="pln"> </span><span class="str">"542d6ecb9ecb3db94b2b3d0f"</span><span class="pun">,</span><span class="pln">
                                  title</span><span class="pun">:</span><span class="pln"> </span><span class="str">"adfadfadfasdf"</span><span class="pun">,</span><span class="pln">
                                  last_reply_at</span><span class="pun">:</span><span class="pln"> </span><span class="str">"2014-10-18T07:47:22.563Z"</span><span class="pln">
                                </span><span class="pun">},</span><span class="pln">
                                reply</span><span class="pun">:</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
                                  id</span><span class="pun">:</span><span class="pln"> </span><span class="str">"543fb7abae523bbc80412b24"</span><span class="pun">,</span><span class="pln">
                                  content</span><span class="pun">:</span><span class="pln"> </span><span class="str">"[@alsotang](/user/alsotang) 哈哈"</span><span class="pun">,</span><span class="pln">
                                  ups</span><span class="pun">:</span><span class="pln"> </span><span class="pun">[</span><span class="pln"> </span><span class="pun">],</span><span class="pln">
                                  create_at</span><span class="pun">:</span><span class="pln"> </span><span class="str">"2014-10-16T12:18:51.566Z"</span><span class="pln">
                                  </span><span class="pun">}</span><span class="pln">
                                </span><span class="pun">},</span><span class="pln">
                            </span><span class="pun">...</span><span class="pln">
                            </span><span class="pun">]</span><span class="pln">
                          </span><span class="pun">}</span><span class="pln">
                        </span><span class="pun">}</span></code></pre>
                    <h4>post /message/mark_all 标记全部已读</h4>
                    <p>接收 post 参数</p>
                    <ul>
                        <li>accesstoken <code>String</code></li>
                    </ul>
                    <p>返回值示例</p>
                    <pre class="prettyprint language-js"><code><span class="pun">{</span><span class="pln"> success</span><span class="pun">:</span><span class="pln"> </span><span class="kwd">true</span><span class="pun">,</span><span class="pln">
                          marked_msgs</span><span class="pun">:</span><span class="pln"> </span><span class="pun">[</span><span class="pln"> </span><span class="pun">{</span><span class="pln"> id</span><span class="pun">:</span><span class="pln"> </span><span class="str">'544ce385aeaeb5931556c6f9'</span><span class="pln"> </span><span class="pun">}</span><span class="pln"> </span><span class="pun">]</span><span class="pln"> </span><span class="pun">}</span></code></pre>
                    <h4>post /message/mark_one/:msg_id 标记单个消息为已读</h4>
                    <p>请求示例：<a href="/message/mark_one/58ec7d39da8344a81eee0c14" target="_blank">/message/mark_one/58ec7d39da8344a81eee0c14</a></p>
                    <p>接收 post 参数</p>
                    <ul>
                        <li>accesstoken <code>String</code></li>
                    </ul>
                    <p>返回值示例</p>
                    <pre class="prettyprint language-js"><code><span class="pun">{</span><span class="pln">
                          success</span><span class="pun">:</span><span class="pln"> </span><span class="kwd">true</span><span class="pun">,</span><span class="pln">
                          marked_msg_id</span><span class="pun">:</span><span class="pln"> </span><span class="str">"58ec7d39da8344a81eee0c14"</span><span class="pln">
                        </span><span class="pun">}</span></code></pre>
                    <h3>知识点</h3>
                    <ol>
                        <li>如何获取 accessToken？ 用户登录后，在设置页面可以看到自己的 accessToken。 建议各移动端应用使用手机扫码的形式登录，验证使用 <code>/accesstoken</code> 接口，登录后长期保存 accessToken。</li>
                    </ol>
                </div>
            </div>



        </div>
        <div class="right">
            <div class="sendArtical">
                <a href="create.html">发布文章</a>
            </div>
            <div class="newsList">
                <h3>最新文章</h3>
                <ul>
                    <li><a href="#">阿里云前端技术周刊第八期</a></li>
                    <li><a href="#">实现一个前端路由，如何实现浏览器的前进与后退 ？</a></li>
                    <li><a href="#">JavaScript 中数组方法 reduce 的妙用之处</a></li>
                    <li><a href="#">IIFE为什么不会污染全局变量</a></li>
                    <li><a href="#">如何实现一个下载进度条/播放进度条</a></li>
                </ul>
            </div>
            <div class="ganggao">
            </div>

            <div class="msg">
                <h3>联系我们</h3>
                <P>手机号:18888888</P>
                <P>QQ:9494985729</P>
                <P>微信:wx8d8d8d8</P>
            </div>
        </div>
    </div>


    
     <!-- 页面底部 -->
     <div class="footer">
            <div class="container-w">
                    <div class="footer-left">
                        <p>初心教育专注于从事互联网IT教育培训,致力于培养高质量互联网行业中高端技术人才,目前开设高级前端全栈学科,java全栈应用学科培养工作中能够快速开发项目能力.</p>
                        <p>公司地址: 武汉市江夏区关南园一路当代光谷梦工厂2栋</p>
                    </div>
                    <div class="footer-right">
                        <div class="phton">
                            <p>联系电话:188888888</p>
                            <p>微信:wx18888888</p>
                            <img src="/images/ewm.jpg" alt="">
                        </div>
                    </div>
            </div>
         
        </div>


    <script src="/js/index.js"></script>
</body>

</html>